export class GlobalHolder {
  private static instance: GlobalHolder = null;

  private globalObjects = new Map<string, Object>();

  private constructor() {
  }

  public static getInstance(): GlobalHolder {
    if (!GlobalHolder.instance) {
      GlobalHolder.instance = new GlobalHolder();
    }
    return GlobalHolder.instance;
  }

  public getObject<T>(key: string): T {
    return this.globalObjects.get(key) as T;
  }

  public setObject<T>(key: string, objectClass: T) {
    this.globalObjects.set(key, objectClass);
  }

  public deleteObject(key: string) {
    this.globalObjects.delete(key);
  }
}

export class GlobalKey {
  static readonly edmContext: string = 'edmContext';
}